Allow ruby to implement screen
software rendering functions
#1551
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Marking this as draft for now, because I was a bit uncertain about whether this was the ideal way to do this, and would also still like to double check everything.
Description
Adds calls into
platform
andruby
for each rendering-related function inscreen
, and adds theusesSoftwareRendering
variable to allow for the future use of a fullyruby
-implemented render path.Motivation / Context
ares currently creates completed guest frames on the CPU, including rendering certain kinds of padding, scaling, and effects, before sending them to the video backend to be post-processed, composited and displayed.
It ought to be more efficient to perform as much of this work as possible directly in the video backend. Certain effects, particularly things like color bleed, could be more efficiently parallelized there (not to mention scaling and other compositing).
ares has expressed interest in moving further with this approach, with the emulation thread essentially just outputting a video signal, with the video backend entirely responsible for assembling this signal into frames. While I think this PR does not quite directly enable this approach1, it begins moving in that direction by allowing the GPU to perform tasks that were previously software-rendered.
The end goal of that work would be to make ares's rendering more efficient, as well as (potentially, maybe) lowering frame latency.
A side benefit of this PR is that the video backend can be informed about the state of
screen
to correct for things like line doubling, interlace mode changes, and other scaling effects while the software-rendering path is still used (#1508).Footnotes
I have not looked at this super closely yet. It seems like this may require changes to
scanline()
? It might also be that withruby
having a reference to thescreen
instance, it can already directly index intopixels
to get granular scanline data timed with e.g. host display presents. ↩